From 896ebbf5bd318caff707acac1aa48cef0c3a2294 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 15 Apr 2004 12:27:31 +0000 Subject: [PATCH] meta tag fixes --- includes/OutputPage.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4141dcb8e5..7d514cf739 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -579,6 +579,12 @@ class OutputPage { $a = array_merge ( $good , $bad ) ; $a = array_slice ( $a , 0 , 10 ) ; # 10 keywords max $a = implode ( "," , $a ) ; + $strip = array( + "/<.*?>/" => '', + "/[_]/" => ' ' + ); + $a = htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),$a )); + $wgOut->addMeta ( "KEYWORDS" , $a ) ; } @@ -644,8 +650,12 @@ class OutputPage { $ret .= "\n"; if ( count( $this->mKeywords ) > 0 ) { + $strip = array( + "/<.*?>/" => '', + "/[_]/" => ' ' + ); $ret .= "mKeywords ) . "\" />\n"; + htmlspecialchars(preg_replace(array_keys($strip), array_values($strip),implode( ",", $this->mKeywords ))) . "\" />\n"; } foreach ( $this->mLinktags as $tag ) { $ret .= "